package com.ezops.businessprocess.integration.usermanagement;

import org.activiti.engine.impl.interceptor.Session;
import org.activiti.engine.impl.interceptor.SessionFactory;
import org.activiti.engine.impl.persistence.entity.UserEntityManager;
import org.activiti.engine.impl.persistence.entity.UserIdentityManager;

import com.ezops.poc.dao.UserDAO;

public class EzopsUserEntityManagerFactory implements SessionFactory {
	private UserDAO userDao;

	@Override
	public Class<?> getSessionType() {
		return UserEntityManager.class;
		//UserIdentityManager
	}

	@Override
	public Session openSession() {
		EzopsUserEntityManager aUserEntityManager = new EzopsUserEntityManager();
		aUserEntityManager.setUserDao(userDao);
		return (Session) aUserEntityManager;
	}

	public void setUserDao(UserDAO userDao) {
		this.userDao = userDao;
	}
}
